{% extends "student/layout.html" %}

{% set page_title = __('意见反馈') %}

{% block content %}
<div class="m-scontent">
	<div class="m-feedback">
		<div class="title">{{__('意见反馈')}}</div>
		<p class="text">{{__('请在下方输入您的意见或建议，我们将非常认真对待每一条反馈，谢谢！')}}</p>
		<form action="" method="post" enctype="multipart/form-data">
			<textarea name="text" name='text' class="form-control" rows="10"></textarea>
			<br />
			<div class="upload">
				<div class="btn-upload">{{__('上传图片或附件（不超过8MB，任意格式）')}}</div>
				<input type="file" class="file" name="file">
				<div class="upload-files"></div>
			</div>
			<div>
				<button class="btn btn-primary btn-send">{{__('发送')}}</button>
			</div>
		</form>
	</div>
</div>
{% endblock %}

{% block js %}
<script type="text/javascript">
$(function(){
	$('.btn-upload').bind('click',function(){
		$('.file').click();
	});
	$('.file').bind('change',function(){
		var filename=$(this).val().replace(/\\/g,'/').split('/');
		filename=filename[filename.length-1];
		$('.upload-files').append('<div class="list">'+filename+'<span class="del">{{__("删除")}}</span></div>')
		$('.btn-upload').hide();
	});
	$('.upload-files').delegate('.del','click',function(){
		$(this).parent().remove();
		$('.file').val('');
		$('.btn-upload').show();
	});
});
</script>
{% endblock %}
